[#ftl]
[@define "agile._MetadataStyleAware"]
	htmlName:null	
	,init:function(){
		
	}	
	,onChange:function(value,name,htmlName){
		//summary: apply style changes to the working widget
		console.log(this.declaredClass,lang.replace("##[_MetadataStyleAware]:value={0},name={1},htmlName={2},has context={3}",[value,name,htmlName,this.context != null]));
		if(this.context && htmlName){
			var ownerWidget = this.context.getCurrentWidget();
			if(ownerWidget){
				ownerWidget.metadata("style."+htmlName,value);
				var jsName = agile.adviseCssName4Js(htmlName);			
				array.forEach(ownerWidget.getStyleNodes(htmlName),function(node){
					style.set(node,jsName,value);
				});
		
				var constraint = ownerWidget.styleConstraints[htmlName];
				if(constraint){					
					constraint.onValueChange(ownerWidget,name,htmlName,value);
				}				
			}
		}
	}
[/@]
